<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>

<body>
    <input type="text" placeholder="姓名" id="d1">
    <input type="text" placeholder="工资" id="d2">
    <input type="text" placeholder="工作" id="d3">
    <input type="button" value="添加" onclick="f()">
    <table border="1">
        <caption>员工列表</caption>
        <tr>
            <th>姓名</th>
            <th>工资</th>
            <th>工作</th>
        </tr>
    </table>

    <script>
        let table = document.querySelector("table");
        function f() {
            let tr = document.createElement("tr");
            let td1 = document.createElement("td");
            let td2 = document.createElement("td");
            let td3 = document.createElement("td");
            td1.innerHTML = document.querySelector("#d1").value;
            td2.innerHTML = document.querySelector("#d2").value;
            td3.innerHTML = document.querySelector("#d3").value;
            tr.append(td1);
            tr.append(td2);
            tr.append(td3);
            table.append(tr);
        }
    </script>



</body>

</html>